import { createRouter, createWebHistory } from "vue-router";

import Layout from "@/views/Layout.vue";

// 发现音乐 王荷婷
import FindMusic from "@/views/FindMusic/index.vue";
import recommend from "@/views/FindMusic/recommend.vue";
import songSteet from "@/views/FindMusic/songSteet.vue";
import MV from "@/views/FindMusic/MV.vue"

// 推荐/动态 郑亮
import Recommend from "@/views/Recommend/index.vue";

// 账户中心 郑亮
import UerCenter from "@/views/UerCenter/index.vue";

// 我的音乐 程哲冲
import MyMusic from "@/views/MyMusic/index.vue";
import MusicList from "@/views/MyMusic/MusicList.vue";
import LocalMusic from "@/views/MyMusic/LocalMusic.vue";
import SteetList from "@/views/MyMusic/SteetList.vue";
import myartistlist from "@/views/MyMusic/myartistlist.vue";
import MyBestLoveMusicVue from "@/views/MyMusic/MyBestLoveMusic.vue";


// 登录注册 江开航
import Login from "@/views/Login/index.vue";
import UserLogin from "@/views/Login/UserLogin.vue";
import PhoneLogin from "@/views/Login/PhoneLogin.vue";
import Register from "@/views/Login/Register.vue";

// 音乐播放器 王雪
import MusicDetail from "@/views/MusicDetail/index.vue";

// 搜索 江开航
import Search from "@/views/Search/index.vue";
import SeachList from "@/views/Search/SeachList.vue";
import artistlist from "@/views/Search/artistlist.vue";
import artistsongs from "@/views/Search/artistsongs.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "layout",
      component: Layout,
      redirect: "/home",
      children: [
        // 首页
        {
          path: "/home",
          name: "home",
          component: FindMusic,
        },
        {
          path: "/home/recommend",
          // name:'recommend',
          component: recommend,
        },
        {
          path: "/home/songsteet/:index",
          name: "songsteet",
          component: songSteet,
        },
        {
          path: "/home/allmv",
          name: "allmv",
          component: MV,
        },
        // 我的音乐
        {
          path: "/mymusic",
          name: "mymusic",
          component: MyMusic,
          children: [
            {
              path: "/mymusic/steetlist",
              name: "steetlist",
              component: SteetList,
            },
            {
              path: "/mymusic/myartistlist",
              name: "myartistlist",
              component: myartistlist,
            },
          ],
        },
        // {
        //   path: "/mymusic/steetlist",
        //   name: "steetlist",
        //   component: SteetList,
        // },
        {
          path: "/mymusic/musiclist/:id",
          name: "musiclist",
          component: MusicList,
        },
        {
          path: "/mymusic/localmusic",
          name: "localmusic",
          component: LocalMusic,
        },
        // {
        //   path:'/mymusic/mybestlovemusic',
        //   name:'mybestlovemusic',
        //   component:MyBestLoveMusicVue
        // },
        // 动态/推荐
        {
          path: "/recommend",
          name: "recommend",
          component: Recommend,
        },
        // 个人中心
        {
          path: "/uercenter",
          name: "uercenter",
          component: UerCenter,
        },

        // // 登录页
        {
          path: "/login",
          name: "login",
          component: Login,
        },
        // 用户名登录页
        {
          path: "/login/userlogin",
          name: "userlogin",
          component: UserLogin,
        },
        // 手机登录页
        {
          path: "/login/phonelogin",
          name: "phonelogin",
          component: PhoneLogin,
        },
        // 注册页
        {
          path: "/login/register",
          name: "register",
          component: Register,
        },

        //音乐播放器
        {
          path: "/musicdetail",
          name: "musicdetail",
          component: MusicDetail,
        },

        //搜索页
        {
          path: "/search",
          name: "search",
          component: Search,
        },
        {
          path: "/artistlist",
          name: "artistlist",
          component: artistlist,
        },
        {
          path: "/artistsongs",
          name: "artistsongs",
          component: artistsongs,
        },
        {
          path: "/search/seachlist/:msg",
          name: "seachlist",
          component: SeachList,
        },
      ],
    },
  ],
});

export default router;
